home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-19 | 35.2 KB | 1,425 lines |
- *** 1.70 1992/03/28 06:40:31
- --- Changelo 1992/04/19 16:03:21
- ***************
- *** 2929,2931 ****
- --- 2929,3069 ----
- doc is mum on this point) -- ++jrb
-
- ---------------------------- Patchlevel 79 ---------------------------
- +
- + gnulib2.c:: ++jrb
- + add gcc 2.0 support routine __fixunssfsi()
- +
- + bblink.c:: ++jrb
- + new file to support gcc -tcov (-tcov is not working as yet, but
- + when it does, we are ready!)
- +
- + mincl:: ++jrb
- + add targets for above
- +
- + doprnt.c:: michal/++jrb
- + had the same problem as osbind for -fomit-frame-pointer, in ICONV
- + change constraints for stuff that is pushed before the sp is reset
- + from "g" to "r".
- + Also, michal optimized ICONV a bit to do the long div only while
- + the number > 65535.
- +
- + signal.h sysvars.h
- + div.c doprnt.c gmon.c main.c sbrk.c system.c: Michal
- + shut off gcc 2.X warnings.
- +
- + *************** RENAME **********************************************
- +
- + rename file _floatsi.cpp to _fltsi.cpp
- +
- + **************************************************************************
- +
- +
- + ********************** REMOVE ******************************************
- + bzero.c, memset.c. memcpy.s
- + *************************************************************************
- +
- + bcopy.s, bzero.cpp:: alexander lehmann
- + efficient replacements for bcopy/bzero/memmove/memset/memcpy
- +
- + bcopy.s:: ++jrb
- + minor adjustment.
- +
- + mincl:: ++jrb
- + adjust targets for above
- +
- + fread.c:: ++jrb
- + remove redundant cast in 'data=(char*)data + m;' since data
- + is a char * now.
- +
- +
- + _cmpdf2.s _cmpsf2.s _fixsfsi.cpp _fltsisf.cpp gnulib2.c:: andreas
- + * gnulib2.c: nothing needed for gcc-2.0 except __fixsfsi and
- + __floatsisf
- + * _fixsfsi.cpp, _fltsisf.cpp: new files
- + * _cmpdf2.s, _cmpsf2.s: new entry points for gcc2
- +
- + in gnulib2.c i #if 0'ed out the not used portions instead of deleting
- + them, just so that we have a handy cross reference around. also note
- + that at the bottom there is still one new gcc 2.X support routine
- + around. ++jrb
- +
- + _fixdfsi.cpp:: andreas
- + some cleanups
- +
- + _floatsi.cpp:: andreas
- + code for __M68881__ was bogus (is this needed anyways?)
- +
- + alloca.s:: andreas
- + remove some wasted bytes
- +
- + console.c:: andreas
- + (raw_in): allow typeahead (which is only available at GEMDOS level).
- +
- + doprnt.c:: andreas
- + -- remove some misuse of NULL; handle %g correctly.
- + -- a version of iconv for -m68020 and also for non __GNUC__
- + -- i merged in earlier iconv change, with one diff: when
- + using the long div, make d1 come out into 'i' by declaring
- + d1 as the reggie for i as andreas had done in his change, rather
- + than use a movw d1, %1 as i had it earlier ++jrb
- +
- + getenv.c putenv.c :: andreas
- + * getenv.c (putenv): put it in separate file as it is independent
- + of getenv
- + * putenv.c: new file
- +
- + getuid.c unistd.h:: andreas
- + * getuid.c: use uid_t and gid_t
- + * unistd.h: ditto
- + note that sete?[gu]id() has int as parameter type so that it
- + matches the old-style definition
- +
- + mkdir.c:: andreas
- + * mkdir.c: stat() on an already unx2dos'd filename is a no-no (and
- + also wastefull), use Fattrib() instead
- +
- + read.c:: andreas
- + (_delchar, str_length): handle ^@ (^@ == (int)0 ++jrb) correctly
- +
- + rmdir.c:: andreas
- + rewrite symbolic directory if dir was nonempty
- +
- + scanf.c :: andreas
- + improve handling of character class
- +
- + stat.c:: andreas
- + allow symbolic link to a deleted path
- +
- + strcoll.c string.h :: andreas
- + * strcoll.c: new file, implementation of strcoll and strxfrm that
- + doesn't know about locales
- + * string.h: add proto for strcoll and strxfrm
- +
- + strftime.c:: andreas
- + echo unknown format char ala printf (otherwise
- + buf is uninitialized)
- +
- + mincl: andreas
- + add target for putenv.o
- + mincl: add taget for strcoll.o
- + adjust gnulib2 targets:
- + add targets for _fixsfsi.o, _fltsisf.o
- + remove targets for _lshrsi3.o,...,_lesf2.o
- +
- + compiler.h float.h signal.h stddef.h stdio.h :: andreas
- + avoid warning `cast to pointer from integer of different size'
- + if -mshort.
- +
- + This is 'fixed' in gcc 2.1 (actually we had the fix for gcc 2.0 PL 2)
- + to not issue this warning for 0 being promoted. but andreas's changes
- + are applicable in any case. ++jrb
- +
- + unx2dos.c:: ++jrb/ers/michal
- + change default unixmode (if not user specified) from "/" to "/d"
- + this takes care of problems dues to caonicalization of PATH to
- + posix form, where D:\foo is mapped internally to "/dev/D/foo. if
- + there was no 'd' in the default unixmode, then a casual
- + user would be surprised why non-spawning application could'nt
- + find stuff in such PATH's (like when using findfile).
- +
- + ---------------------------- Patchlevel 80 ---------------------------
- *** 1.55 1992/03/28 06:40:31
- --- PatchLev.h 1992/04/19 16:03:24
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "79"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "80"
-
- /*
- *
- *** 1.1 1990/03/26 17:37:08
- --- _cmpdf2.s 1992/04/19 16:03:28
- ***************
- *** 13,21 ****
- --- 13,29 ----
- .text
- .even
- .globl __cmpdf2, ___cmpdf2
- + | additional entry points for gcc2
- + .globl ___eqdf2, ___nedf2, ___gtdf2, ___gedf2, ___ltdf2, ___ledf2
-
- __cmpdf2:
- ___cmpdf2:
- + ___eqdf2:
- + ___nedf2:
- + ___gtdf2:
- + ___gedf2:
- + ___ltdf2:
- + ___ledf2:
- moveml sp@(4),d0-d1/a0-a1 | get u and v
- tstl d0 | check sign bit
- bpl 1f
- *** 1.1 1990/03/26 17:37:08
- --- _cmpsf2.s 1992/04/19 16:03:28
- ***************
- *** 13,21 ****
- --- 13,29 ----
- .text
- .even
- .globl __cmpsf2, ___cmpsf2
- + | additional entry points for gcc2
- + .globl ___eqsf2, ___nesf2, ___gtsf2, ___gesf2, ___ltsf2, ___lesf2
-
- __cmpsf2:
- ___cmpsf2:
- + ___eqsf2:
- + ___nesf2:
- + ___gtsf2:
- + ___gesf2:
- + ___ltsf2:
- + ___lesf2:
- moveml sp@(4),d0-d1 | get u and v
- tstl d1 | check sign bit
- bpl 1f
- *** 1.1 1992/02/04 17:11:06
- --- _fixdfsi.cpp 1992/04/19 16:03:30
- ***************
- *** 78,83 ****
- --- 78,87 ----
- | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
- | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
- |
- + | modified by Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de):
- + | no loop needed for the shift-down case
- + | testing for far shifts now too slow
- + | use different registers to gain speed
- |
- | Revision 1.3, kub 01-90 :
- | added support for denormalized numbers
- ***************
- *** 100,163 ****
- __fixdfsi:
- ___fixdfsi:
- lea sp@(4),a0 | pointer to parameters
- ! moveml d2/d4/d5,sp@- | save registers
- ! moveml a0@,d4-d5 | get the number
- ! movew a0@,d0 | extract exp
- ! movew d0,d2 | extract sign
- ! lsrw #4,d0
- ! andw #0x07ff,d0 | kill sign bit
-
- ! andl #0x0fffff,d4 | remove exponent from mantissa
- ! orl #0x100000,d4 | restore implied leading "1"
-
- ! cmpw #BIAS8,d0 | check exponent
- blt zero | strictly factional, no integer part ?
- ! cmpw #BIAS8+32,d0 | is it too big to fit in a 32-bit integer ?
- bgt toobig
-
- ! subw #BIAS8+21,d0 | adjust exponent
- bgt 2f | shift up
- ! beq 3f | no shift
-
- ! cmpw #-8,d0 | replace far shifts by swap
- ! bgt 1f
- ! movew d4,d5 | shift fast, 16 bits
- ! swap d5
- ! clrw d4
- ! swap d4
- ! addw #16,d0 | account for swap
- ! bgt 2f
- ! beq 3f
- !
- ! 1: lsrl #1,d4 | shift down to align radix point;
- ! addw #1,d0 | extra bits fall off the end (no rounding)
- ! blt 1b | shifted all the way down yet ?
- ! bra 3f
- !
- ! 2: addl d5,d5 | shift up to align radix point
- ! addxl d4,d4
- ! subw #1,d0
- bgt 2b
-
- ! 3: movel d4,d0 | put integer into result register
- ! cmpl #0x80000000,d0 | -2147483648 is a nasty evil special case
- bne 6f
- ! tstw d2 | this had better be -2^31 and not 2^31
- bpl toobig
- bra 8f
- 6: tstl d0 | sign bit set ? (i.e. too big)
- bmi toobig
- 7:
- ! tstw d2 | is it negative ?
- bpl 8f
- negl d0 | negate
- 8:
- ! moveml sp@+,d2/d4/d5
- rts
-
- zero:
- clrl d0 | make the whole thing zero
- ! bra 7b
-
- toobig:
- movel #0x7fffffff,d0 | ugh. Should cause a trap here.
- --- 104,156 ----
- __fixdfsi:
- ___fixdfsi:
- lea sp@(4),a0 | pointer to parameters
- ! moveml d2/d3,sp@- | save registers
- ! moveml a0@,d0-d1 | get the number
- ! movew a0@,d2 | extract exp
- ! movew d2,d3 | extract sign
- ! lsrw #4,d2
- ! andw #0x07ff,d2 | kill sign bit
-
- ! andl #0x0fffff,d0 | remove exponent from mantissa
- ! orl #0x100000,d0 | restore implied leading "1"
-
- ! cmpw #BIAS8,d2 | check exponent
- blt zero | strictly factional, no integer part ?
- ! cmpw #BIAS8+32,d2 | is it too big to fit in a 32-bit integer ?
- bgt toobig
-
- ! subw #BIAS8+21,d2 | adjust exponent
- bgt 2f | shift up
- ! beq 7f | no shift (never too big)
-
- ! negw d2
- ! lsrl d2,d0 | shift down to align radix point;
- ! | extra bits fall off the end (no rounding)
- ! bra 7f | never too big
- !
- ! 2: addl d1,d1 | shift up to align radix point
- ! addxl d0,d0
- ! subw #1,d2
- bgt 2b
-
- ! 3: cmpl #0x80000000,d0 | -2147483648 is a nasty evil special case
- bne 6f
- ! tstw d3 | this had better be -2^31 and not 2^31
- bpl toobig
- bra 8f
- 6: tstl d0 | sign bit set ? (i.e. too big)
- bmi toobig
- 7:
- ! tstw d3 | is it negative ?
- bpl 8f
- negl d0 | negate
- 8:
- ! moveml sp@+,d2/d3
- rts
-
- zero:
- clrl d0 | make the whole thing zero
- ! bra 8b
-
- toobig:
- movel #0x7fffffff,d0 | ugh. Should cause a trap here.
- ***************
- *** 192,198 ****
- #endif ERROR_CHECK
-
- # if !defined (sfp004) && !defined (__M68881__)
- ! bra 7b
- #else
- rts
- #endif
- --- 185,191 ----
- #endif ERROR_CHECK
-
- # if !defined (sfp004) && !defined (__M68881__)
- ! bra 8b
- #else
- rts
- #endif
- *** 1.1 1992/02/04 17:11:06
- --- _floatsi.cpp 1992/04/19 16:03:31
- ***************
- *** 12,20 ****
-
- __floatsidf:
- ___floatsidf:
- ! fmovel a7@(4),fp0 | load long int to fp0
- ! fintrzd a4@(4),fp0 | get double from fp0
- ! fmoved fp0,a7@-
- moveml a7@+,d0-d1
- rts
-
- --- 12,19 ----
-
- __floatsidf:
- ___floatsidf:
- ! fintrzd a7@(4),fp0 | load long int to fp0
- ! fmoved fp0,a7@- | get double from fp0
- moveml a7@+,d0-d1
- rts
-
- *** 1.4 1989/09/01 01:34:53
- --- alloca.s 1992/04/19 16:03:39
- ***************
- *** 19,24 ****
- subl d0,sp | increase stack frame size by that much
- movel sp,d0 | set up to return it
-
- ! lea sp@(-4),sp | new top of stack (real bug fix here)
-
- jmp a0@ | return by jmping via saved addr
- --- 19,24 ----
- subl d0,sp | increase stack frame size by that much
- movel sp,d0 | set up to return it
-
- ! subql #4,sp | new top of stack (real bug fix here)
-
- jmp a0@ | return by jmping via saved addr
- *** 1.10 1992/03/28 06:40:31
- --- console.c 1992/04/19 16:03:47
- ***************
- *** 85,91 ****
- raw_in(dev)
- int dev;
- {
- ! return Bconin(in_dev(dev));
- }
-
- #if 0
- --- 85,96 ----
- raw_in(dev)
- int dev;
- {
- ! if (dev < 3)
- ! return Bconin (dev);
- ! else if (dev == 3)
- ! return Crawcin ();
- ! else
- ! return Cauxin ();
- }
-
- #if 0
- ***************
- *** 218,221 ****
- }
- }
- }
- -
- --- 223,225 ----
- *** 1.3 1991/06/23 17:07:09
- --- div.c 1992/04/19 16:03:50
- ***************
- *** 36,44 ****
- movl %3,sp@-
- movl %2,sp@-
- jsr ___divsi3
- movl d0,%0
- ! movl d1,%1
- ! addqw #8,sp"
- : "=g"(result.quot), "=g"(result.rem)
- : "r"(num), "r"(denom)
- ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
- --- 36,44 ----
- movl %3,sp@-
- movl %2,sp@-
- jsr ___divsi3
- + addqw #8,sp
- movl d0,%0
- ! movl d1,%1"
- : "=g"(result.quot), "=g"(result.rem)
- : "r"(num), "r"(denom)
- ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
- *** 1.10 1992/03/06 19:19:47
- --- doprnt.c 1992/04/19 16:03:50
- ***************
- *** 23,28 ****
- --- 23,29 ----
- */
-
- #ifndef __NO_FLOAT__
- + #if 0
- static unsigned long
- __notanumber[2] = { 0x7fffffffL, 0xffffffffL }; /* ieee NAN */
- #define NAN (*((double *)&__notanumber[0]))
- ***************
- *** 31,36 ****
- --- 32,44 ----
- #define INF (*((double *)&__p_infinity[0]))
- #endif
-
- + #define NAN_HI 0x7fffffffL
- + #define NAN_LO 0xffffffffL
- + #define INF_HI 0x7ff00000L
- + #define INF_LO 0x00000000L
- +
- + #endif /* __NO_FLOAT__ */
- +
- #ifdef LIBC_SCCS
- static char sccsid[] = "@(#)doprnt.c 5.37 (Berkeley) 3/26/89";
- #endif /* LIBC_SCCS */
- ***************
- *** 101,143 ****
- #endif
-
- #ifdef __GNUC__
- ! #define _ICONV(NUMBER, BASE, BUF) \
- { \
- ! short i; \
- ! if(NUMBER <= 65535L) \
- { \
- ! do \
- ! { \
- ! __asm__ volatile(" \
- ! divu %3,%2; \
- ! swap %0; \
- ! movw %0,%1; \
- ! clrw %0; \
- ! swap %0" \
- ! : "=d"((long)NUMBER), "=g"(i) \
- ! : "0"((long)NUMBER), "g"((short)BASE)); \
- ! *--BUF = digs[i]; \
- ! } while(NUMBER); \
- } \
- ! else \
- { \
- ! extern unsigned long __udivsi3(); /* quot = d0, rem = d1 */ \
- ! do \
- ! { \
- ! __asm__ volatile(" \
- ! movl %3,sp@-; \
- ! movl %2,sp@-; \
- ! jsr ___udivsi3; \
- ! movl d0,%0; \
- ! movw d1,%1; \
- ! addqw #8,sp" \
- ! : "=g"((long)NUMBER), "=g"(i) \
- ! : "0"((long)NUMBER), "g"((long)BASE) \
- : "d0", "d1", "a0", "a1"); \
- *--BUF = digs[i]; \
- - } while(NUMBER); \
- } \
- }
- #endif /* __GNUC__ */
-
-
- --- 109,175 ----
- #endif
-
- #ifdef __GNUC__
- ! #ifdef __M68020__
- !
- ! #define _ICONV(NUMBER, BASE, BUF) \
- { \
- ! long i; \
- ! do \
- { \
- ! __asm__ volatile \
- ! ("divull %3,%0:%1" \
- ! : "=d"((long)(NUMBER)), "=d"(i) \
- ! : "0"((long)(NUMBER)), "d"((long)(BASE))); \
- ! *--(BUF) = digs[i]; \
- } \
- ! while (NUMBER); \
- ! }
- !
- ! #else /* !__M68020 */
- !
- ! #define _ICONV(NUMBER, BASE, BUF) \
- ! { \
- ! \
- ! while((NUMBER) > 65535L) \
- { \
- ! extern unsigned long __udivsi3(); /* quot = d0, rem = d1 */ \
- ! register long i __asm ("d1"); \
- ! __asm__ volatile("
- ! movl %3,sp@-;
- ! movl %2,sp@-;
- ! jsr ___udivsi3;
- ! addqw #8,sp;
- ! movl d0,%0" \
- ! : "=r"((long)NUMBER), "=d"(i) \
- ! : "0"((long)NUMBER), "r"((long)BASE) \
- : "d0", "d1", "a0", "a1"); \
- *--BUF = digs[i]; \
- } \
- + do \
- + { \
- + short i; \
- + __asm__ volatile("
- + divu %3,%2;
- + swap %0;
- + movw %0,%1;
- + clrw %0;
- + swap %0" \
- + : "=d"((long)NUMBER), "=g"(i) \
- + : "0"((long)NUMBER), "g"((short)BASE)); \
- + *--BUF = digs[i]; \
- + } while(NUMBER); \
- }
- +
- + #endif /* __M68020 */
- +
- + #else /* !__GNUC__ */
- +
- + #define _ICONV(NUMBER, BASE, BUF) \
- + do { \
- + *--(BUF) = digs[(NUMBER) % (BASE)]; \
- + (NUMBER) /= (BASE); \
- + } while (NUMBER);
- +
- #endif /* __GNUC__ */
-
-
- ***************
- *** 279,285 ****
- /* mjr: check for NANs */
- #define _double _dd.d
- _double = va_arg(argp, double);
- ! if( (unsigned long)_dd.i[0] == __notanumber[0]) {
- t = buf;
- t = strcpy(t, " Not A Number ");
- size = strlen(t);
- --- 311,318 ----
- /* mjr: check for NANs */
- #define _double _dd.d
- _double = va_arg(argp, double);
- ! if (_dd.i[0] == NAN_HI)
- ! {
- t = buf;
- t = strcpy(t, " Not A Number ");
- size = strlen(t);
- ***************
- *** 307,317 ****
- else
- softsign = 0;
- /* mjr: check for +-INFINITY */
- ! if(
- ! ((unsigned long)_dd.i[0] == __p_infinity[0])
- ! /* && ((unsigned long)_dd.i[1] == __p_infinity[1]) */
- ! /* mjr: don't test this in order to catch a conversion bug in gcc-as */
- ! ) {
- t = buf;
- if(softsign == 0)
- t = strcpy(t, " Infinity ");
- --- 340,348 ----
- else
- softsign = 0;
- /* mjr: check for +-INFINITY */
- ! if (((unsigned long)_dd.i[0] == INF_HI) &&
- ! ((unsigned long)_dd.i[1] == INF_LO))
- ! {
- t = buf;
- if(softsign == 0)
- t = strcpy(t, " Infinity ");
- ***************
- *** 322,331 ****
- }
- /*
- * cvt may have to round up past the "start" of the
- ! * buffer, i.e. ``intf("%.2f", (double)9.999);'';
- ! * if the first char isn't NULL, it did.
- */
- ! *buf = (char)NULL;
- size = cvt(_double, (int)prec, (int)flags, &softsign,
- *fmt, buf, buf + (int)sizeof(buf));
- if (softsign)
- --- 353,362 ----
- }
- /*
- * cvt may have to round up past the "start" of the
- ! * buffer, i.e. ``printf("%.2f", (double)9.999);'';
- ! * if the first char isn't '\0', it did.
- */
- ! *buf = '\0';
- size = cvt(_double, (int)prec, (int)flags, &softsign,
- *fmt, buf, buf + (int)sizeof(buf));
- if (softsign)
- ***************
- *** 420,433 ****
- */
- t = buf + BUF;
- if (_ulong != 0 || prec != 0) {
- - #ifndef __GNUC__
- - do {
- - *--t = digs[_ulong % base];
- - _ulong /= base;
- - } while (_ulong);
- - #else
- _ICONV(_ulong, base, t);
- - #endif
- digs = "0123456789abcdef";
- if (flags & ALT && base == 8 && *t != '0')
- *--t = '0'; /* octal leading 0 */
- --- 451,457 ----
- ***************
- *** 671,680 ****
- fract = modf(fract * 10, &tmp);
- *t++ = tochar((int)tmp);
- } while(!tmp);
- }
- ! while (--prec && fract) {
- fract = modf(fract * 10, &tmp);
- *t++ = tochar((int)tmp);
- }
- }
- if (fract)
- --- 695,706 ----
- fract = modf(fract * 10, &tmp);
- *t++ = tochar((int)tmp);
- } while(!tmp);
- + prec--;
- }
- ! while (prec && fract) {
- fract = modf(fract * 10, &tmp);
- *t++ = tochar((int)tmp);
- + prec--;
- }
- }
- if (fract)
- *** 1.12 1992/03/28 06:40:31
- --- fread.c 1992/04/19 16:03:57
- ***************
- *** 46,52 ****
- fp->_cnt -= cnt;
- fp->_ptr += cnt;
- l += cnt;
- ! data = (char *)data + cnt;
- n -= cnt;
- }
- /* n == how much more */
- --- 46,52 ----
- fp->_cnt -= cnt;
- fp->_ptr += cnt;
- l += cnt;
- ! data = data + cnt;
- n -= cnt;
- }
- /* n == how much more */
- *** 1.7 1992/03/06 19:19:47
- --- getenv.c 1992/04/19 16:04:01
- ***************
- *** 10,17 ****
-
- extern char ** environ;
-
- - static void del_env __PROTO((const char *strng));
- -
- char *
- getenv(tag)
- const char *tag;
- --- 10,15 ----
- ***************
- *** 26,91 ****
- if (!strncmp(name, tag, len) && name[len] == '=')
- return name+len+1;
- }
- - return 0;
- - }
- -
- - static void
- - del_env(strng)
- - const char *strng;
- - {
- - char **var;
- - char *name;
- - size_t len = 0;
- -
- - if (!environ) return;
- -
- - /* find the length of "tag" in "tag=value" */
- - for (name = (char *)strng; *name && (*name != '='); name++)
- - len++;
- -
- - /* find the tag in the environment */
- - for (var = environ; name = *var; var++) {
- - if (!strncmp(name, strng, len) && name[len] == '=')
- - break;
- - }
- -
- - /* if it's found, move all the other environment variables down by 1 to
- - delete it
- - */
- - if (name) {
- - while (name) {
- - name = var[1];
- - *var++ = name;
- - }
- - }
- - }
- -
- - int
- - putenv(strng)
- - char *strng;
- - {
- - int i = 0;
- - char **e;
- -
- - del_env(strng);
- -
- - if (!environ)
- - e = (char **) malloc(2*sizeof(char *));
- - else {
- - while(environ[i]) i++ ;
- - e = (char **) malloc((i+2)*sizeof(char *));
- - if (!e) {
- - return -1;
- - }
- - bcopy(environ, e, (i+1)*sizeof(char *));
- - free(environ);
- - environ = e;
- - }
- - if (!e)
- - return -1;
- -
- - environ = e;
- - environ[i] = strng;
- - environ[i+1] = 0;
- return 0;
- }
- --- 24,28 ----
- *** 1.7 1992/03/06 19:19:47
- --- getopt.c 1992/04/19 16:04:02
- ***************
- *** 42,48 ****
- int
- getopt( argc, argv, optstring ) /* returns letter, '?', EOF */
- int argc; /* argument count from main */
- ! char *argv[]; /* argument vector from main */
- const char *optstring; /* allowed args, e.g. "ab:c" */
- {
- static int sp = 1; /* position within argument */
- --- 42,48 ----
- int
- getopt( argc, argv, optstring ) /* returns letter, '?', EOF */
- int argc; /* argument count from main */
- ! char *const *argv; /* argument vector from main */
- const char *optstring; /* allowed args, e.g. "ab:c" */
- {
- static int sp = 1; /* position within argument */
- *** 1.5 1991/04/12 18:19:53
- --- getuid.c 1992/04/19 16:04:04
- ***************
- *** 6,25 ****
- #include <unistd.h>
-
- /* pretending we are root (0,0) is probably not a good idea */
- ! static int euid = 1, egid = 1;
- ! static int uid = 1, gid = 1;
-
- ! int getuid() { return uid; }
- ! int geteuid(){ return euid; }
-
- ! int getgid() { return gid; }
- ! int getegid() { return egid; }
-
- ! int setuid(x) int x; { return uid = x; }
- ! int setgid(x) int x; { return gid = x; }
-
- ! int seteuid(x) int x; { return euid = x; }
- ! int setegid(x) int x; { return egid = x; }
-
- int setpgrp() { return getpid(); }
- int getpgrp() { return getpid(); }
- --- 6,25 ----
- #include <unistd.h>
-
- /* pretending we are root (0,0) is probably not a good idea */
- ! static uid_t euid = 1, uid = 1;
- ! static gid_t egid = 1, gid = 1;
-
- ! uid_t getuid() { return uid; }
- ! uid_t geteuid(){ return euid; }
-
- ! gid_t getgid() { return gid; }
- ! gid_t getegid() { return egid; }
-
- ! uid_t setuid(x) int x; { return uid = x; }
- ! gid_t setgid(x) int x; { return gid = x; }
-
- ! uid_t seteuid(x) int x; { return euid = x; }
- ! gid_t setegid(x) int x; { return egid = x; }
-
- int setpgrp() { return getpid(); }
- int getpgrp() { return getpid(); }
- *** 1.7 1991/12/26 15:53:59
- --- gmon.c 1992/04/19 16:04:06
- ***************
- *** 588,594 ****
- case 0x11201985L:
- case 0x02061986L:
- case 0x04241986L:
- ! act_pd = (BASEPAGE **) 0x602C;
- break;
- default:
- act_pd = (BASEPAGE **) sysbase[10];
- --- 588,594 ----
- case 0x11201985L:
- case 0x02061986L:
- case 0x04241986L:
- ! act_pd = (BASEPAGE **) 0x602CL;
- break;
- default:
- act_pd = (BASEPAGE **) sysbase[10];
- *** 1.8 1992/03/06 19:19:47
- --- gnulib2.c 1992/04/19 16:04:06
- ***************
- *** 30,35 ****
- --- 30,36 ----
- #define L_floatdidf
-
- /* gcc-2.0 stuff */
- + #if 0 /* NOTE: these are now covered, and should not be generated here */
- #define L_lshrsi3
- #define L_lshlsi3
- #define L_ashrsi3
- ***************
- *** 48,53 ****
- --- 49,56 ----
- #define L_gesf2
- #define L_ltsf2
- #define L_lesf2
- + #endif
- + #define L_fxussfsi
-
- #endif /* __DEF_ALL__ */
-
- ***************
- *** 240,245 ****
- --- 243,249 ----
- __EXTERN long long __fixdfdi __PROTO((double a));
- __EXTERN double __floatdidf __PROTO((long long u));
- __EXTERN int __builtin_saveregs __PROTO((void));
- + __EXTERN unsigned SItype __fixunssfsi __PROTO((float a));
-
- #ifdef L_adddi3
- long long
- ***************
- *** 1088,1093 ****
- --- 1092,1098 ----
- union flt_or_int { long int i; float f; };
- #endif
-
- + #if 0 /* NOTE: all these come from elsewhere now */
- #ifdef L_lshrsi3
- #if 0
- SItype
- ***************
- *** 1622,1625 ****
- --- 1627,1643 ----
- movel sp@+,d2
- rts
- ");
- + #endif
- + #endif /* # if 0 to ensure that the above functions are not compiled */
- +
- +
- + #ifdef L_fxussfsi
- + #include <limits.h>
- + unsigned SItype
- + __fixunssfsi (float a)
- + {
- + if (a >= - (float) LONG_MIN)
- + return (SItype) (a + LONG_MIN) - LONG_MIN;
- + return (SItype) a;
- + }
- #endif
- *** 1.21 1992/01/29 20:58:29
- --- main.c 1992/04/19 16:04:12
- ***************
- *** 36,42 ****
- {
- long *cookie;
-
- ! cookie = *((long **) 0x5a0);
- if (!cookie)
- __mint = 0;
- else {
- --- 36,42 ----
- {
- long *cookie;
-
- ! cookie = *((long **) 0x5a0L);
- if (!cookie)
- __mint = 0;
- else {
- *** 1.16 1992/03/06 19:19:47
- --- mincl 1992/04/19 16:04:14
- ***************
- *** 1,9 ****
- #
- # GCC specific stuff
- GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
- ! _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _floatsi.o \
- _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
- ! _truncdf.o _udivmod.o _umulsi3.o
-
- #GLIB2 = gnulib2.o
- GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
- --- 1,9 ----
- #
- # GCC specific stuff
- GLIB1 = _addsubd.o _addsubs.o _cmpdf2.o _cmpsf2.o _divdf3.o _divmods.o \
- ! _divsf3.o _extends.o _fixdfsi.o _fxunsd.o _fltsi.o \
- _muldf3.o _mulsf3.o _mulsi3.o _negdf2.o _negsf2.o _normdf.o _normsf.o \
- ! _truncdf.o _udivmod.o _umulsi3.o _fixsfsi.o _fltsisf.o
-
- #GLIB2 = gnulib2.o
- GLIB2 = _adddi3.o _subdi3.o _muldi3.o _divdi3.o _moddi3.o _udivdi3.o \
- ***************
- *** 10,23 ****
- _umoddi3.o _negdi2.o _anddi3.o _iordi3.o _xordi3.o _lshrdi3.o \
- _lshldi3.o _ashldi3.o _ashrdi3.o _one_cmpldi2.o _bdiv.o _cmpdi2.o \
- _ucmpdi2.o _fixunsdfdi.o _fixdfdi.o _floatdidf.o \
- ! _lshrsi3.o _lshlsi3.o _ashrsi3.o _ashlsi3.o _eqdf2.o \
- ! _nedf2.o _gtdf2.o _gedf2.o _ltdf2.o _ledf2.o _fixsfsi.o \
- ! _floatsisf.o _eqsf2.o _nesf2.o _gtsf2.o _gesf2.o _ltsf2.o \
- ! _lesf2.o
-
- GCC= $(GLIB1) $(GLIB2) \
- ldexp.o frexp.o modf.o alloca.o setjmp.o osbind.o\
- ! linea.o alglobal.o sysvar.o gmon.o screen.o stksiz.o binmode.o
- #
- # ANSI stuff + support
- ANSI = atol.o atof.o abort.o bsearch.o clock.o ctime.o ctype.o difftime.o \
- --- 10,21 ----
- _umoddi3.o _negdi2.o _anddi3.o _iordi3.o _xordi3.o _lshrdi3.o \
- _lshldi3.o _ashldi3.o _ashrdi3.o _one_cmpldi2.o _bdiv.o _cmpdi2.o \
- _ucmpdi2.o _fixunsdfdi.o _fixdfdi.o _floatdidf.o \
- ! _fxussfsi.o
-
- GCC= $(GLIB1) $(GLIB2) \
- ldexp.o frexp.o modf.o alloca.o setjmp.o osbind.o\
- ! linea.o alglobal.o sysvar.o gmon.o screen.o stksiz.o binmode.o \
- ! bblink.o
- #
- # ANSI stuff + support
- ANSI = atol.o atof.o abort.o bsearch.o clock.o ctime.o ctype.o difftime.o \
- ***************
- *** 25,31 ****
- fputc.o fputs.o fread.o fwrite.o fseek.o fsetpos.o \
- fprintf.o sprintf.o \
- fscanf.o scanf.o sscanf.o \
- ! getenv.o gets.o getw.o localtim.o \
- malloc.o qsort.o raise.o rand.o setbuf.o setvbuf.o \
- setlocal.o strftime.o strtol.o system.o \
- tmpnam.o tmpfile.o \
- --- 23,29 ----
- fputc.o fputs.o fread.o fwrite.o fseek.o fsetpos.o \
- fprintf.o sprintf.o \
- fscanf.o scanf.o sscanf.o \
- ! getenv.o putenv.o gets.o getw.o localtim.o \
- malloc.o qsort.o raise.o rand.o setbuf.o setvbuf.o \
- setlocal.o strftime.o strtol.o system.o \
- tmpnam.o tmpfile.o \
- ***************
- *** 43,50 ****
-
- STRING = strcat.o strchr.o strcmp.o strcpy.o strcspn.o strdup.o \
- strlen.o strncat.o strncmp.o strncpy.o strpbrk.o strrchr.o strspn.o \
- ! strtok.o strstr.o memcpy.o memccpy.o memcmp.o memchr.o memset.o \
- ! bcopy.o bcmp.o bzero.o strerror.o
- #
- # stuff to fake unix system calls
-
- --- 41,48 ----
-
- STRING = strcat.o strchr.o strcmp.o strcpy.o strcspn.o strdup.o \
- strlen.o strncat.o strncmp.o strncpy.o strpbrk.o strrchr.o strspn.o \
- ! strtok.o strstr.o memccpy.o memcmp.o memchr.o \
- ! bcopy.o bcmp.o bzero.o strerror.o strcoll.o
- #
- # stuff to fake unix system calls
-
- ***************
- *** 96,102 ****
- _divsf3.o: _divsf3.cpp
- _extends.o: _extends.cpp
- _fixdfsi.o: _fixdfsi.cpp
- ! _floatsi.o: _floatsi.cpp
- _fxunsd.o: _fxunsd.cpp
- _muldf3.o: _muldf3.cpp
- _mulsf3.o: _mulsf3.cpp
- --- 94,100 ----
- _divsf3.o: _divsf3.cpp
- _extends.o: _extends.cpp
- _fixdfsi.o: _fixdfsi.cpp
- ! _fltsi.o: _fltsi.cpp
- _fxunsd.o: _fxunsd.cpp
- _muldf3.o: _muldf3.cpp
- _mulsf3.o: _mulsf3.cpp
- ***************
- *** 103,111 ****
- --- 101,112 ----
- _normdf.o: _normdf.cpp
- _normsf.o: _normsf.cpp
- _truncdf.o: _truncdf.cpp
- + _fixsfsi.o: _fixsfsi.cpp
- + _fltsisf.o: _fltsisf.cpp
- frexp.o: frexp.cpp
- ldexp.o: ldexp.cpp
- modf.o: modf.cpp
- + bzero.o: bzero.cpp
-
- #
- # integer only io stuff
- ***************
- *** 121,127 ****
-
- # other dependencies
- bcopy.o : bcopy.s
- - memcpy.o: memcpy.s
- atof.o : flonum.h
-
- #
- --- 122,127 ----
- ***************
- *** 149,157 ****
- rm -f $(IIOBJ)
- rm -f setjmp.s div.s
- rm -f _addsubd.s _addsubs.s _divdf3.s _divsf3.s _extends.s _fixdfsi.s
- ! rm -f _floatsi.s _fxunsd.s _muldf3.s _mulsf3.s _normdf.s _normsf.s
- ! rm -f _truncdf.s frexp.s ldexp.s modf.s
- !
- realclean: clean
- rm -f $(ALL) $(ALL020)
-
- --- 149,157 ----
- rm -f $(IIOBJ)
- rm -f setjmp.s div.s
- rm -f _addsubd.s _addsubs.s _divdf3.s _divsf3.s _extends.s _fixdfsi.s
- ! rm -f _fltsi.s _fxunsd.s _muldf3.s _mulsf3.s _normdf.s _normsf.s
- ! rm -f _truncdf.s frexp.s ldexp.s modf.s bzero.s
- ! rm -f _fixsfsi.s _fltsisf.s
- realclean: clean
- rm -f $(ALL) $(ALL020)
-
- *** 1.10 1992/03/06 19:19:47
- --- mkdir.c 1992/04/19 16:04:17
- ***************
- *** 8,15 ****
- #include <support.h>
- #include <unistd.h>
- #include <errno.h>
- - #include <types.h>
- - #include <stat.h>
- #include "symdir.h"
- #include "lib.h"
-
- --- 8,13 ----
- ***************
- *** 20,26 ****
- int mode;
- {
- int rv, name_munged;
- - struct stat statbuf;
- char path[FILENAME_MAX];
-
- /*
- --- 18,23 ----
- ***************
- *** 31,44 ****
- */
- name_munged = (unx2dos(_path, path) == _NM_CHANGE);
-
- ! rv = stat(path, &statbuf); /* Stat directory */
- ! if (rv == 0) { /* Does it exist ? */
- errno = EEXIST; /* Yes, so tell user. */
- return -1;
- }
-
- ! if (errno != ENOENT) { /* Return stat error, if other than */
- ! return -1; /* File not found. */
- }
-
- rv = Dcreate(path);
- --- 28,42 ----
- */
- name_munged = (unx2dos(_path, path) == _NM_CHANGE);
-
- ! rv = Fattrib(path, 0, 0); /* Get file attributes */
- ! if (rv >= 0) { /* Does it exist ? */
- errno = EEXIST; /* Yes, so tell user. */
- return -1;
- }
-
- ! if (rv != -ENOENT) { /* Return stat error, if other than */
- ! errno = -rv; /* File not found. */
- ! return -1;
- }
-
- rv = Dcreate(path);
- *** 1.16 1992/03/22 21:57:30
- --- read.c 1992/04/19 16:04:22
- ***************
- *** 31,37 ****
- #endif
-
- #define iswhite(c) ((c) == ' ' || (c) == '\t')
- ! #define isvisable(c) ((c) >= ' ' && (c) < 0x7f)
- #define echochar(fd, c) if (__ttymode & ECHO) (void) _echochar(fd, c); else
- #define delchar(fd, n) if (__ttymode & ECHO) _delchar(fd, n); else
-
- --- 31,37 ----
- #endif
-
- #define iswhite(c) ((c) == ' ' || (c) == '\t')
- ! #define isvisable(c) ((unsigned char)(c) >= ' ')
- #define echochar(fd, c) if (__ttymode & ECHO) (void) _echochar(fd, c); else
- #define delchar(fd, n) if (__ttymode & ECHO) _delchar(fd, n); else
-
- ***************
- *** 297,303 ****
- int len = 0;
- char c = thebuf[n];
-
- ! if ((c > 0 && c < ' ') || (c == 0x7f)) {
- if (c == '\t')
- len = __col_pos - str_length(thebuf, n);
- else
- --- 297,303 ----
- int len = 0;
- char c = thebuf[n];
-
- ! if ((c >= 0 && c < ' ') || c == 0x7f) {
- if (c == '\t')
- len = __col_pos - str_length(thebuf, n);
- else
- ***************
- *** 322,328 ****
-
- while (n--) {
- c = *p++;
- ! if ((c > 0 && c < ' ') || (c == 0x7f))
- if (c == '\t')
- pos = (pos | 7) + 1;
- else
- --- 322,328 ----
-
- while (n--) {
- c = *p++;
- ! if ((c >= 0 && c < ' ') || c == 0x7f)
- if (c == '\t')
- pos = (pos | 7) + 1;
- else
- *** 1.8 1991/06/11 23:04:27
- --- rmdir.c 1992/04/19 16:04:24
- ***************
- *** 60,65 ****
- --- 60,68 ----
- *s = 0; /* restore name */
- }
- r = Ddelete(path);
- + if (r < 0 && dir)
- + /* rewrite symbolic directory if dir was nonempty */
- + (void)_write_symdir (path, dir);
- }
- if (r < 0) {
- errno = -r;
- *** 1.10 1992/03/06 19:19:47
- --- sbrk.c 1992/04/19 16:04:24
- ***************
- *** 67,73 ****
- return lsbrk(n);
- }
- errno = ENOMEM;
- ! rval = (void *)-1;
- }
- return rval;
- }
- --- 67,73 ----
- return lsbrk(n);
- }
- errno = ENOMEM;
- ! rval = (void *)(-1L);
- }
- return rval;
- }
- *** 1.13 1992/01/29 20:58:29
- --- scanf.c 1992/04/19 16:04:25
- ***************
- *** 115,121 ****
- /* Character-buffer pointer. */
- register char *str;
- /* Workspace. */
- ! char work[200];
- char *w; /* Pointer into WORK. */
-
- if ((format == NULL) || (!*format))
- --- 115,121 ----
- /* Character-buffer pointer. */
- register char *str;
- /* Workspace. */
- ! char work[256];
- char *w; /* Pointer into WORK. */
-
- if ((format == NULL) || (!*format))
- ***************
- *** 494,520 ****
- }
- else
- not_in = 0;
- !
- ! while ((fc = *f++) != '\0' && fc != ']')
- ! {
- ! if (fc == '-' && *f != '\0' && *f != ']' &&
- ! w > work && w[-1] <= *f)
- /* Add all characters from the one before the '-'
- ! up to (but not including) the next format char. */
- ! for (fc = w[-1] + 1; fc < *f; ++fc)
- ! *w++ = fc;
- ! else
- ! /* Add the character to the list. */
- ! *w++ = fc;
- }
- if (fc == '\0')
- conv_error();
-
- ! *w = '\0';
- unum = read_in;
- do
- {
- ! if ((strchr(work, c) == NULL) != not_in)
- break;
- if (do_assign)
- *str++ = c;
- --- 494,524 ----
- }
- else
- not_in = 0;
- ! w = (char *)f; /* remember start of class */
- ! bzero (work, 256);
- ! while ((fc = *f++) != '\0' && (fc != ']' || f - 1 == w))
- ! {
- ! /* Add the character to the list. */
- ! work[(unsigned char)fc] = 1;
- ! /* Look ahead for a range. */
- ! if (f[0] == '-' && f[1] != '\0' && f[1] != ']')
- ! {
- /* Add all characters from the one before the '-'
- ! up to the next format char. */
- ! unsigned char end = f[1];
- ! while ((unsigned char)++fc <= end)
- ! work[(unsigned char)fc] = 1;
- ! f += 2;
- ! }
- }
- if (fc == '\0')
- conv_error();
-
- ! work[0] = not_in;
- unum = read_in;
- do
- {
- ! if (work[(unsigned char)c] == not_in)
- break;
- if (do_assign)
- *str++ = c;
- *** 1.17 1992/01/29 20:58:29
- --- stat.c 1992/04/19 16:04:30
- ***************
- *** 170,176 ****
-
- if (!(d = _do_stat(path))) {
- /* errno was set by _do_stat */
- ! if (errno == ENOENT && nval == _NM_LINK) {
- /* here we have a symbolic link to a deleted file */
- st->st_mode = S_IFLNK | 0644;
- st->st_ino = ++__inode;
- --- 170,176 ----
-
- if (!(d = _do_stat(path))) {
- /* errno was set by _do_stat */
- ! if ((errno == ENOENT || errno == EPATH) && nval == _NM_LINK) {
- /* here we have a symbolic link to a deleted file */
- st->st_mode = S_IFLNK | 0644;
- st->st_ino = ++__inode;
- *** 1.4 1991/04/26 03:42:08
- --- strftime.c 1992/04/19 16:04:34
- ***************
- *** 196,201 ****
- --- 196,205 ----
- strftime(buf, sizeof buf, "%H:%M:%S", ts);
- break;
- #endif
- + default:
- + buf[0] = q;
- + buf[1] = 0;
- + break;
- }
-
- if (num + (len = strlen(putstr)) >= maxsize)
- *** 1.15 1992/03/22 21:57:30
- --- system.c 1992/04/19 16:04:40
- ***************
- *** 28,34 ****
- #endif
-
- #define isquote(c) ((c) == '\"' || (c) == '\'' || (c) == '`')
- ! #define ARG_ERR ( (Argentry *) -1 )
-
- /* struct. used to build a list of arguments for the command */
-
- --- 28,34 ----
- #endif
-
- #define isquote(c) ((c) == '\"' || (c) == '\'' || (c) == '`')
- ! #define ARG_ERR ( (Argentry *) -1L )
-
- /* struct. used to build a list of arguments for the command */
-
- *** 1.21 1992/01/29 20:58:29
- --- unx2dos.c 1992/04/19 16:04:44
- ***************
- *** 39,45 ****
- * it's assumed that the user will set this via a definition
- * char *_default_unixmode = whatever
- * if no such definition is present (i.e. _default_unixmode is 0) then
- ! * "/" is assumed
- */
-
- char *_default_unixmode;
- --- 39,45 ----
- * it's assumed that the user will set this via a definition
- * char *_default_unixmode = whatever
- * if no such definition is present (i.e. _default_unixmode is 0) then
- ! * "/d" is assumed
- */
-
- char *_default_unixmode;
- ***************
- *** 86,92 ****
- /* compatibility with older versions of the library */
- switch(_unixmode) {
- case 0: mode = ""; break;
- ! case 1: mode = "/"; break;
- case 2: mode = "/.,"; break;
- default: mode = "/.,LAHd"; break;
- }
- --- 86,92 ----
- /* compatibility with older versions of the library */
- switch(_unixmode) {
- case 0: mode = ""; break;
- ! case 1: mode = "/d"; break; /* 'd' added to default */
- case 2: mode = "/.,"; break;
- default: mode = "/.,LAHd"; break;
- }
-